﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditTextMaterialDialog.aspx.cs" Inherits="ZLCMS.Web.SystemManage.weixin.Material.EditTextMaterialDialog" %>


<%@ Import Namespace ="ZLCMS.Business.Util" %>

<form id="pageForm" class="pageForm required-validate">
    
<div class="pageContent">
    <div class="pageFormContent" layoutH="56">
        <dl class="nowrap">
            <dt>素材分类：</dt>
            <dd><%= ParamKit.GetValue("WXMaterialType", "text", "&nbsp;")%></dd>
        </dl>
        <dl class="nowrap">
            <dt>名称：</dt>
            <dd>
                <input id="matName" type="text" value="<%=_materialDb.Title %>"/>            
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>内容：</dt>
            <dd>
            <textarea id="matContent" cols="75" rows="20"><%=_textDb.Content%></textarea></dd>
        </dl>
        <dl class="nowrap">
            <dt>注意：</dt>
            <dd>（1、内容长度不超过2048字节，约300个汉字）<br />
                （2、如需要添加链接，请使用以下代码：&lt;a href=&quot;http://www.domain.com/page.html&quot;&gt;链接名字&lt;/a&gt;）</dd>
        </dl>
                <input id="matid" type="hidden" value="<%=_materialDb.Id %>"/>    
	</div>
	
    <div class="formBar">
		<ul>
            <li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="saveTextMaterial()">保存</button></div></div></li>
			<li>
				<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
			</li>
		</ul>
	</div>
</div>

<script type="text/javascript">
    function saveTextMaterial() {
        var param = {};
        param.Name = $('#matName', $.pdialog.getCurrent()).val();
        param.Content = $('#matContent', $.pdialog.getCurrent()).val();
        param.Id = $('#matid', $.pdialog.getCurrent()).val();
        param.UserCode = '<%=UserKit.GetUserAccountFailLogin() %>'
        if (param.Id == '') {
            param.Id = 0;
        }
        $('#pageForm', $.pdialog.getCurrent()).ExecuteCommand({ successCallBack: function (result, totalCount) {
            alertMsg.correct('数据提交成功！');
            $.pdialog.closeCurrent();
            $.pdialog.closeDialogCallback(result.Data);
        }
        }, 'SaveTextMaterial', param);
    }
</script>
</form>